#ifndef __THREAD_H__
#define __THREAD_H__

#include <pthread.h>
#include <functional>
#include "Noncopyable.h"

using std::function;

namespace tp
{
class Thread : Noncopyable
{
    typedef function<void()> Func;
public:
    Thread(const Func&);
    ~Thread();

    void start();
    void join();

    static void* threadFunc(void*);
private:
    pthread_t _pthID;
    bool _isRunning;
    Func _cb;
};
}

#endif
